package com.java.demo;

import com.java.demo.controller.UserController;
import com.java.demo.controller.UserController1;
import com.java.demo.controller.UserController2;
import com.java.demo.model.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Scope;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.stereotype.Component;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 马拉圈
 * Date: 2023-07-22
 * Time: 14:24
 */

@Component
public class Test {

    @Autowired
    private UserController userController;
    @Autowired
    private UserController1 userController1;
    @Autowired
    private UserController2 userController2;

    public static void main(String[] args) {
        ApplicationContext context = new ClassPathXmlApplicationContext("spring-config.xml");
        Test test = context.getBean("test", Test.class);
        test.userController.doMethod();
        test.userController1.doMethod();
        test.userController2.doMethod();

    }

}
